{extend name="common@base/common" /}

{block name="style"}
<link href="__CSS__/main.min.css" type="text/css" rel="stylesheet">
{/block}
{block name="body"}
{include file="muushop/public/_nav"/}
<div id="main-container" class="container">
	<header class="color-main vertical-box">
	    <h3 class="header-title">领劵中心</h3>
	</header>
	<section class="coupon-section">
		{notempty name="coupon"}
		{volist name="coupon" id="data"}
		{include file="muushop/coupon/_item"}
		{/volist}
		<div class="page">{$page}</div>
		{/notempty}
	</section>
</div>
{/block}
{block name="script"}
<script>
$(function(){
	$('[data-role="get-coupon"]').click(function(){

		var url = $(this).data('url');
		$.get(url,function(ret){
			if(ret.code==1){
				//todo:领取成功后应该弹出高逼格动画~让用户很爽的样子
				toast.success(ret.msg, '温馨提示');
			}else{
				toast.error(ret.msg, '温馨提示');
			}
			
		})
	})
})
</script>
{/block}